package com.ruoyi.common.enums;

/**
 * 项目请求报告Publish status枚举值
 */
public enum WalmartPublishStatus {
	PUBLISHED(1, "Published"),
	UNPUBLISHED(2, "Unpublished"),
	STAGE(3, "Stage"),
	IN_PROGRESS(4, "In progress"),
	SYSTEM_PROBLEM(5, "System problem");

	private final Integer value;
	private final String name;

	// Constructor to assign values
	WalmartPublishStatus(Integer value, String name) {
		this.value = value;
		this.name = name;
	}

	// Getter for value
	public Integer getValue() {
		return value;
	}

	// Getter for name
	public String getName() {
		return name;
	}

	// Optional: Method to get enum by integer value
	public static WalmartPublishStatus fromValue(Integer value) {
		for (WalmartPublishStatus status : WalmartPublishStatus.values()) {
			if (status.getValue().equals(value)) {
				return status;
			}
		}
		throw new IllegalArgumentException("Unexpected value: " + value);
	}

	// Optional: Method to get enum by name (String)
	public static WalmartPublishStatus fromName(String name) {
		for (WalmartPublishStatus status : WalmartPublishStatus.values()) {
			if (status.getName().equals(name)) {
				return status;
			}
		}
		throw new IllegalArgumentException("Unexpected name: " + name);
	}
}
